cmake_minimum_required(VERSION 3.1)
project(rpc)

set(INC_DIR /usr/local/include)
include_directories(${INC_DIR})

find_package(PkgConfig REQUIRED)
pkg_check_modules(ZMQ libzmq)
link_directories(${ZMQ_LIBRARY_DIRS})
include_directories(${ZMQ_INCLUDE_DIRS})

# #查找zerozmq
# find_package(ZeroMQ REQUIRED)
# include_directories(${ZeroMQ_INCLUDE_DIRS})

include_directories("${PROJECT_SOURCE_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/example")

#server 
    set(SERVER_SRC
        src/rpc_simplifier.h
        src/rpc_simplifier.cpp
        example/server.cpp
        )

    add_executable(rpc_server ${SERVER_SRC})
target_link_libraries(rpc_server ${ZMQ_LIBRARIES} pthread)#链接起来

#client
set(CLIENT_SRC
    src/rpc_simplifier.h
    src/rpc_simplifier.cpp
    example/client.cpp
    )
add_executable(rpc_client ${CLIENT_SRC})
target_link_libraries(rpc_client ${ZMQ_LIBRARIES} pthread)